/// <reference path="../_all.ts" />

module Application.Resources {
    export interface IActionClass extends ng.resource.IResourceClass {
    }

    export interface IAction extends ng.resource.IResource {
        action_id: number;
        server_id: number;
        user_id: number;
        action: string;
        status: string;
        is_success: boolean;
        is_executed: boolean;
        is_processing: boolean;
        action_datetime: Date;
        start_datetime: Date;
        end_datetime: Date;
        user_name: string;
        user: Application.Resources.IUser;
    }

    export class ActionUtility {
        static fixBooleans(item: IAction) {
            item.is_success = Application.Utility.Booleans.parse(item.is_success);
            item.is_executed = Application.Utility.Booleans.parse(item.is_executed);
            item.is_processing = Application.Utility.Booleans.parse(item.is_processing);
        }
    }
}